<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Con_form extends CI_Controller {

    public function __construct() 
    {
        parent::__construct();
    }  	
   
	public function index()
	{
            $this->form_validation->set_rules('id_user', 'id_user', 'required|trim|min_length[1]');
            $this->form_validation->set_rules('codigo', 'codigo', 'required|trim|min_length[5]');
            $this->form_validation->set_rules('user', 'usuario', 'required|trim|min_length[5]');
            $this->form_validation->set_rules('pass', 'contrase�a', 'required|trim|md5');
            $this->form_validation->set_rules('repass', 'reescribir contrase�a', 'required|matches[pass]|trim|md5');
		
            if($this->form_validation->run()==FALSE){   
                $this->load->view('view_form');	
            }else{
                $data['id'] = $this->input->post('id_user');
		$data['usuario'] = $this->input->post('user');
		$data['codigo'] = $this->input->post('codigo');
                $data['pass'] = $this->input->post('pass');
                $data['esadmin'] = $this->input->post('isadmin');
                $data['nombre'] = $this->input->post('nombre');
                $data['correo'] = $this->input->post('email');
                $data['fecha'] = $this->input->post('fecha_expiracion');
                $data['activo'] = $this->input->post('activo');
                $data['id_socursal'] = $this->input->post('id_socursal');
                $data['id_tipo_usurario'] = $this->input->post('id_tipo_usurario');            
                print_r($data);	
            }
	}
}

/* End of file con_form.php */
/* Location: ./application/controllers/con_form.php */